package cn.edu.tju.elm.repository;

import cn.edu.tju.elm.model.CreditHistory;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CreditHistoryRepository extends JpaRepository<CreditHistory, Long> {
    
    /**
     * 根据钱包ID查找信用历史记录，按时间倒序排列
     */
    List<CreditHistory> findByWalletIdOrderByCreateTimeDesc(Long walletId);
    
    /**
     * 根据钱包ID和事件类型查找信用历史记录
     */
    List<CreditHistory> findByWalletIdAndEventTypeOrderByCreateTimeDesc(Long walletId, String eventType);
}